package com.neouton.crm.managerPayRequest.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.crm.entity.SysUserEntity;
import com.neouton.crm.managerPayRequest.entity.ManagerPayRequest;
import com.neouton.crm.managerPayRequest.entity.ManagerPaymentTable;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ManagerPayRequestMapper {

    IPage<ManagerPayRequest> queryManagerPayRequestList(@Param("page") IPage page, @Param("entity") ManagerPayRequest managerPayRequest,  @Param("userList")List<SysUserEntity> userList);

    void saveManagerPayRequest(@Param("vo")ManagerPayRequest entity);

    List<ManagerPayRequest> queryManagerPayRequestMoney(@Param("vo") ManagerPayRequest managerPayRequest);

    ManagerPayRequest queryManagerPayRequestByID(Integer payRequestId);

    void backUpManagerPayRequest(@Param("payRequestId")Integer payRequestId,  @Param("backUserId")Integer userId);

    void updateManagerPayRequestById(@Param("vo")ManagerPayRequest entity);

    ManagerPayRequest queryManagerPayRequestHistory(Integer approvalId);

    void savePaymentTable(@Param("List")List<ManagerPaymentTable> list);

    List<ManagerPaymentTable> queryPaymentTablesByApprovalId(Integer approvalId);

    void updateRequestTableData(@Param("List")List<ManagerPaymentTable> list, @Param("approvalId")Integer approvalId);

    void backUpManagerPaymentTable(@Param("payRequestId")Integer payRequestId, @Param("backUserId")Integer userId);

    List<ManagerPaymentTable> queryPayTablesByIdAndPlanPeriod(@Param("vo") ManagerPaymentTable entity);
    void updatePaymentTableDataById(@Param("List")List<ManagerPaymentTable> list, @Param("payRequestId")Integer payRequestId);

    List<ManagerPayRequest> queryPaymentRequestListInfo(@Param("entity")ManagerPayRequest entity, @Param("userList")List<SysUserEntity> userList);

    Boolean deletePayedRequestById(Integer payRequestId);

    void updatePrIsNotById(@Param("payRequestId") Integer payRequestId, @Param("prIsNot")String s);
}
